package com.icangya.domain;



import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "balance_info")
public class Balance {//用户金额记录表

        private Long id;
        /**
         * 用户id
         */
        private long uid;
        /**
         * 用户余额
         */
        private Long money;//分为单位

        private String openId;//用户id

        private Long userPoint;//用户商城积分

        /**
         * 创建时间
         */
        private Timestamp createTime;
        /**
         * 修改时间
         */
        private Timestamp modifiedTime;


        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        @Column(name = "id")
        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }
        @Basic
        @Column(name = "uid")
        public long getUid() {
            return uid;
        }

        public void setUid(long uid) {
            this.uid = uid;
        }

        @Basic
        @Column(name = "money")
        public Long getMoney() {
            return money;
        }

        public void setMoney(Long money) {
            this.money = money;
        }

        @Basic
        @Column(name = "user_point")
        public Long getUserPoint() {
            return userPoint;
        }

        public void setUserPoint(Long userPoint) {
            this.userPoint = userPoint;
        }

    @Basic
        @Column(name = "create_time")
        public Timestamp getCreateTime() {
            return createTime;
        }

        public void setCreateTime(Timestamp createTime) {
            this.createTime = createTime;
        }

        @Basic
        @Column(name = "modified_time")
        public Timestamp getModifiedTime() {
            return modifiedTime;
        }

        public void setModifiedTime(Timestamp modifiedTime) {
            this.modifiedTime = modifiedTime;
        }

    public Balance(long uid, Long money, Long userPoint, Timestamp createTime, Timestamp modifiedTime) {
        this.uid = uid;
        this.money = money;
        this.userPoint = userPoint;
        this.createTime = createTime;
        this.modifiedTime = modifiedTime;
    }

    @Basic
    @Column(name = "openid")
    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public Balance() {
    }

    @Override
    public String toString() {
        return "Balance{" +
                "id=" + id +
                ", uid=" + uid +
                ", money=" + money +
                ", userPoint=" + userPoint +
                ", createTime=" + createTime +
                ", modifiedTime=" + modifiedTime +
                '}';
    }
}
